<!doctype html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="style.css">
  <link id="flipper-theme-import" rel="stylesheet">
  <link rel="stylesheet" href="graphiql/graphiql.css">
  <link rel="stylesheet" href="vis/vis.min.css">
  <title>Flipper</title>
  <style>
    #loading {
      -webkit-app-region: drag;
      z-index: 999999;
      position: absolute;
      top: 0;
      left: 0;
      bottom: 0;
      right: 0;
      padding: 50px;
      overflow: auto;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 20px;
      color: #525252;
      text-align: center;
    }

  </style>
</head>

<body>
  <div id="root">
    <div id="loading">
      Loading...
    </div>
  </div>
  <script>
    global.electronRequire = window.require;
  </script>
  <script>
    // load correct theme (n.b. this doesn't handle system value specifically, will assume light in such cases)
    try {
      if (JSON.parse(window.process.env.CONFIG).darkMode === 'dark') {
        document.getElementById('flipper-theme-import').href = "themes/dark.css";
      } else {
        document.getElementById('flipper-theme-import').href = "themes/light.css";
      }
    } catch (e) {
      console.error("Failed to initialize theme", e);
      document.getElementById('flipper-theme-import').href = "themes/light.css";
    }
  </script>
  <script src="bundle.js"></script>
</body>

</html>
